package com.zhiying.mybatis;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import com.zhiying.domain.CMS_User;
import com.zhiying.domain.Role;
import com.zhiying.domain.UserLoginLog;
import com.zhiying.domain.UserRole;
import com.zhiying.domain.UserVO;
import com.zhiying.page.PageInfo;

public interface UserMapper {

	List<UserVO> selectByPage(@Param("pageInfo")PageInfo pageInfo, @Param("search")String search,RowBounds rowBounds);
    //查询uservo集合
	int deleteUserById(@Param("id")Long id);
	//删除用户数据
	CMS_User selectUserById(@Param("id")Long id);
	//根据用户id查询用户信息
	List<Role> listByUserIds( @Param("status")Integer status,@Param("userId") Long userId );
    //查询角色信息
	int updateUserById(@Param("org_id")int org_id,@Param("cms_user")CMS_User cms_user);
    //修改用户信息
    int deleteUserRole(@Param("id") int id);
    //删除用户角色信息
    int insertUserRoles(@Param("userRoles")List<UserRole> userRole);
    //新增用户角色信息		
    int updateStatus(@Param("cms_user")CMS_User cms_user);
    //修改用户状态
    
    List<UserLoginLog> listByPage(@Param("userId") Long userId, @Param("pageInfo") PageInfo pageInfo,
			@Param("search") String search, RowBounds rowBounds);
    //查询登陆日志
    int insertLoginLog(@Param("userLoginLog")UserLoginLog userLoginLog);
    
    int insertNewUser(@Param("cmsUser")CMS_User cmsUser,@Param("organizationId")int organizationId);

	int selectCMSUserCount(@Param("search")String search);
	
	int selectCMSUserLoginLog(@Param("userId")int userId,@Param("search")String search);

	int updateUserPasswordById(@Param("password")String password,@Param("userId") int userId);
	//修改密码
	String selectUserByPassword(@Param("nowpassword")String nowpassword);
 
	int updateAdminInfoByUserId(@Param("cmsuser")CMS_User cmsuser);
}
